<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
	if(count($brands) > 0 || count($items) > 0){
		echo '<a class="prev browse left "></a>';
		echo '<div class="scrollable">';
		echo '<div class="items">';
			echo '<div class="item">';
			$i = 0;
			if(count($brands) > 0){
				foreach($brands as $brand){
					echo "<div class='one-slider-item'>";
					if (is_file('./uploads/catalog_brands/'.$brand['brand_id'].'/small/'.$brand['brand_image'])) {
						$im = getimagesize('./uploads/catalog_brands/'.$brand['brand_id'].'/small/'.$brand['brand_image']);
						$margin = round((120 - $im[1]) / 2);
						echo '<a href="/"><img src="/uploads/catalog_brands/'.$brand['brand_id'].'/small/'.$brand['brand_image'].'" style="margin: '.$margin.'px auto;" /></a>';
						$i++;
					}
					echo "</div>";
					if($i%4 == 0){
						echo '<br class="cc" /></div><div class="item">';
					}
				}
			}
			if(count($items) > 0){
				foreach($items as $item){
					echo "<div class='one-slider-item'>";
					if (is_file("./uploads/catalog_items/".$item['item_id'].'/small/'.$item['image']['photo_file'])) {
							$im = getimagesize("./uploads/catalog_items/".$item['item_id'].'/small/'.$item['image']['photo_file']);
							$margin = round((120 - $im[1]) / 2);
						echo '<a href="/catalog/'.$item['item_id'].'/"><img src="/uploads/catalog_items/'.$item['item_id'].'/small/'.$item['image']['photo_file'].'" style="margin: '.$margin.'px auto;" /></a><br />';
					}
						echo '<a href="/catalog/'.$item['item_id'].'/"><p>'.$item['item_title'].'</p></a>';
					echo "</div>";
					$i++;
					if($i%4 == 0){
						echo '<br class="cc" /></div><div class="item">';
					}
				}
			}
			echo '</div>';
		echo '</div>';
		echo '</div>';
		echo '<a class="next browse right "></a>';
	}
?>